Earth Resistivity OCX Notes 14MAR03

If this text is not wrapped, click on EDIT (above) and select WORD WRAP

SERIAL OCX

Since I finalised the Earth Resistivity Logger for publication, reader Joe Farr has provided EPE with a specially written SerialIO.OCX program that allows legal access to Visual Basic's own serial control I/O facilities. This option has previously only been available to readers who have a registered version of MSCOMM (as Robert Penfold has discussed many times through his Interface series).

Joe's serial OCX facility will be published in full at a later date - not yet scheduled. However, a section of Joe's program has been built into this Earth Resistivity (ER) program and is available to readers who are using the EarthResist.EXE standalone version.

To use Joe's option, though, several changes need to be made to ER's PCB, without which the facility cannot function. They are:

1. Cut the track (0V) connecting to IC7 (MAX232) pin 13.

2. Connect IC7 (MAX232) pin 13 to 9-pin serial socket SK3 pin 3.

3. Connect IC7 (MAX232) pin 12 to IC5 (PIC) pin 18 (RC7).

This action allows the PIC to receive handshake data from the PC.

To set the PIC program to respond to the correct serial data transmission routine, initiate the following procedure:

1. Before switching on power, press and hold down the Mode switch, S6.

2. The screen will go into serial path change mode, alternating at about one-second intervals between a display saying "SERIAL PORT NORM" (original version) and "SERIAL PORT OCX " (Joe's OCX).

3. Release switch S6 when the mode you require is shown. This mode becomes the active path mode and is also stored into the PIC's data EEPROM, to be recalled next time the program is run. 

4. On release of switch S6, normal running of the PIC program resumes. The serial path mode may be changed whenever you choose.

5. Ensure that the PC is also set for the chosen mode, as follows:

Exit this text file and use the buttons then shown to choose between this new OCX option and the original (normal) serial mode. Click YES for Joe's OCX, NO if you want to use the normal serial download as originally written into the ER program, or CANCEL to exit without making a change to the serial path used (the screen display repeats these options).

Your choice is recorded to disk and recalled next time the program is run. You may change your mind at another time if you wish, re-entering via this text file to do so.

Note that the same mode must be selected for the PIC and the PC. 

The advantage of Joe's program is that it allows a bargraph to display the progress of the data input procedure. It is also likely to be better at detecting input data problems as it uses a handshake procedure to communicate with the PIC, inputting the 32768 bytes of data in blocks of 256 bytes.

Whilst the original program inputs data that is usually 100% accurate, there is the occasional loss of synchronisation, which is reported on screen, allowing you to re-download if you prefer, although minor "first aid" is provided by the program to regain sync after that point. It is rare, though, for more than one loss of sync to occur. Such loss should not occur with Joe's OCX program.

It should be noted that readers who wish to make their own changes to the ER source code cannot make use of Joe's OCX input option. For that to be used, the installation of Joe's full OCX facility is required. For copyright reasons this will not become available to readers until its publication, whose date is not yet fixed. Attempting to examine the ER source code will generate an error condition because of the presence of Joe's program. Until Joe's full serial program becomes available, the ER program can only be recompiled if Joe's sub-program (EarthResOCX) and all references to it in the main program are removed.

Also be aware that this version of ER with Joe's OCX has not yet been proved on a wide variety machines. If it will not work on your PC, revert to using the normal serial download option on PIC and PC. Please advise me at HQ if this is necessary, telling me the PC and its operating system type.

On exit from this text screen, make your choice via the buttons then offered (this is the only path through which they can be accessed).


SURVEY CURRENT MONITORING

Another feature added to this version is the ability to monitor the current flowing between the transmission (TX) probes. It too requires a small change to the PCB:

1. Cut the track between resistor R16 and pin 7 of IC4.

2. Connect the now-open end of R16 to the pole of switch S2.

With switch S2 in the R5 (1k resistor) position, current flows from the switch pole through the 1k resistor and to 0V via the resistance of the soil. These two resistances form a potential divider. The square wave voltage at their junction is buffered by R16 and half-wave rectified by diode D2. The resulting peak positive voltage is monitored via PIC pin RA0 operating in analogue (ADC mode). The peak voltage depends on the resistance of the soil, and from this voltage value, the equivalent relative current through the resistance path can be calculated.

To establish an initial reference value prior to any survey, switch on the unit. Then set switch S2 to the setting that directly connects the pole to IC3 output pin 6. Do not connect transmission probe C1 to socket SK2 at this time. Press switch S6 (Mode) and hold it pressed, then press switch S8 (Save) and hold it pressed until the message REF SAVED appears, preceded by a value. Release S8, then release S6. The value shown is now stored to the PIC's EEPROM for present and future use. Then switch S2 to the 1k resistor (R5) path.

During active surveying, the voltage at the pole of S2 is subtracted from the reference value and stored as a 6-bit number into bits 1 to 6 of the MSB of the survey value recorded to the external serial EEPROM IC6. The range of current values acceptable is from 0 to 63, and the actual value is displayed as the second value on LCD line 1 when in Test Mode (S9 on). It is followed by the letter A. The first value shown (followed by B) is that monitored from IC4b pin 8, as described in the text. The output from IC4a is no longer monitored via the LCD.

If current values greater than 62 are encountered, they are limited to 63, and the word MAX is display on the LCD. Switch S2 may be used to select one of the other resistors (R3 to R6) in the event that the site being surveyed has greater or lesser resistance than appropriate to a 1k fixed resistor value. Do not change the resistor value during a survey.

The PC program stores the full 2-byte survey value to disk. On re-input the current value is extracted from the MSB, and the MSB is then limited to one active bit (bit 0). The range of survey values is then from 0 to 511. During surveying, the gain setting via switch S3 should be chosen to keep the values below 511, favouring a middle range centred on 256. If a value greater than 511 is encountered by the PIC, it is limited to 511 and the word MAX is shown on the LCD.

All three display screens of the PC program now have an extra tick box marked Current. When it is ticked, each survey value is multiplied by its associated current value divided by 10. The theory is that slight differences in the transmission current value at each survey grid square affect the actual value of the received voltage signal from the receiving probes. By relating these voltages to their prevailing transmission current, compensation is made for variations in the latter. The current values are not actual milliamp values, but simply numbers representing the relative current flowing.

It is suspected, however, that in practice the variations make little difference to the interpretation of the displayed results. To repeat the statement made in Part 1, the aim of this logger is to show relative differences in signal amplitude across a site being surveyed. It is the differences that then indicate different sub-soil features. If there are significant differences they are worth physical investigation. If there are no significant differences, then the site is probably not worth examining further, unless such techniques as magnetometry or ground-penetrating radar reveal differently. A magnetometer design is currently being worked on and will be published in EPE at some time in the future, but not yet scheduled.

I shall be interested to learn if you find that the current-monitoring feature enhances the results of your survey. Let me know via EPE HQ.

DOT MATRIX

A further option added to the PC program since Part 1 is the dot-matrix display facility, operative when the Matrix tick-box on the Full Grid screen is ticked. This draws small squares on the display whose dimensions are relative to the signal amplitude. The principle is a bit like the dots that make up a B&W photograph in a newspaper (known as half-tone). It will be more useful with a large amount of survey data on screen than with a small quantity.

The main discussion about using this ER Logger, and of the type of probing techniques that can be employed, is covered in Part 2, EPE May '03.

John Becker 14MAR03




